import { createRouter, createWebHashHistory } from 'vue-router'

const routes = [
  {
    path: '/login',
    component: () => import('@/views/login/index.vue'),
    name: 'MBTI 综合管理系统',
    meta: { title: 'MBTI 综合管理系统' }
  },
  {
    path: '/404',
    component: () => import('@/views/404.vue'),
    hidden: true
  },
  {
    path: '/admin',
    component: () => import('@/views/admin/index.vue'),
    redirect: '/Info',
    name: '总览',
    meta: { title: '总览' },
    children: [
      {
        path: '/Info',
        component: () => import('@/views/admin/children/welcome.vue'),
        name: '总览',
        meta: { title: '总览' }
      },
      {
        path: '/college',
        component: () => import('@/views/admin/children/college.vue'),
        name: '学院管理',
        meta: { title: '学院管理' }
      },
      {
        path: '/major',
        component: () => import('@/views/admin/children/major.vue'),
        name: '专业管理',
        meta: { title: '专业管理' }
      },
      {
        path: '/class',
        component: () => import('@/views/admin/children/class.vue'),
        name: '班级管理',
        meta: { title: '班级管理' }
      },
      {
        path: '/student',
        component: () => import('@/views/admin/children/student.vue'),
        name: '学生管理',
        meta: { title: '学生管理' }
      },
      {
        path: '/question',
        component: () => import('@/views/admin/children/question.vue'),
        name: '题库管理',
        meta: { title: '题库管理' }
      },
      {
        path: '/result',
        component: () => import('@/views/admin/children/result.vue'),
        name: '结果管理',
        meta: { title: '结果管理' }
      },
      {
        path: '/visual',
        component: () => import('@/views/admin/children/visual.vue'),
        name: '数据可视化',
        meta: { title: '数据可视化' }
      }
    ]
  },
  {
    path: '/student',
    component: () => import('@/views/student/index.vue'),
    name: '测试面板',
    meta: { title: '测试面板' }
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
